package org.ms.springcloud.feign.consumer;

import org.ms.springcloud.service.api.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FeignController {

    @Autowired
    private UserFeignClient userFeignClient;

    @GetMapping("/userFeign/{id}")
    public User userFeign(@PathVariable("id") Long id) {
        return userFeignClient.findUserById(id);
    }

}
